<?php
require 'common/Utility.php';
require 'db/configuration.php';
require 'crud/CustomSecurity.class.php';
require 'crud/Category.class.php';
require 'crud/Products.class.php';
require 'crud/Shoplist.class.php';

if(isset($_POST['elementid'])){
	update($_POST['elementid'], $_POST['newvalue']);
}

function update($id, $newvalue){
	$slist = new Shoplist(con());
	$slist->update($id, "kolichestvo", $newvalue);
	echo '<script language="javascript" type="text/javascript" defer> document.getElementById('.$id.').innerHTML = '.$newvalue.';</script>';
	
}

?>